﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Cemit.PolyServer
{
    public static class ServerConfigStartExtensions
    {
        public static T StartWithConfig<T>(this T server) where T : PolyServer
        {
            Jsons.Get("ServerConfig")
                .Read(out string ip, "IP")
                .Read(out int port, "Port", int.Parse);

            server.Start(ip, port);
            return server;
        }
    }
}
